package ItoS;

public class StringTest {
    public static void main(String[] args) {
//        int to String
        int num = 10;
        String s1 = "" + num; // So stupid!
        System.out.println(s1);

//        So standard!
        String s2 = String.valueOf(num);
        System.out.println(s2);

//        String to int

//      valueOf()
        Integer i1 = Integer.valueOf("2365");
        int val = i1.intValue();
        double dVal= i1.doubleValue();
        System.out.println(val);
        System.out.println(dVal);

//        parseInt()
        Integer i2 = Integer.parseInt("9864");
        System.out.println(i2);
    }
}
